package com.lcke.common.init;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * <p>
 * 参数配置 服务类
 * </p>
 *
 * @author smk
 * @since 2020年8月17日14:03:33
 */

@Slf4j
@Component
@EnableScheduling
public class TaskInit implements CommandLineRunner {
    @Autowired

    private JdbcTemplate jdbcTemplate;

    @Override
    public void run(String... args) {
        log.info("程序启动完成后执行。");
    }

    @Scheduled(cron = "0 */2 * * * ?")
    public void clearDataJob() {
        log.info("每两分钟执行");
    }
}
